package com.kx.yooli.kx.wechat.controller.bill;

import com.kx.yooli.kx.wechat.po.result.AjaxResult;
import com.kx.yooli.kx.wechat.service.IBillService;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.apache.http.HttpStatus;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;

/**
 * @author john_sqwen
 * @date 2024/3/20
 * @PROJECT_NAME wechat
 * @description create BillController by john_sqwen
 * and billController value is
 */
@RestController
@RequestMapping("/api/bill")
@Tag(name = "bill" ,description = "账单controller")
public class BillController {
    protected final Logger log = LoggerFactory.getLogger(BillController.class);
    private final IBillService iBillService;

    public BillController(IBillService iBillService) {
        this.iBillService = iBillService;
    }
    @RequestMapping(value = "/selectCurrBill",method = RequestMethod.POST)
    public AjaxResult selectCurrBill(@RequestParam("mobile") String mobile){
        //return AjaxResult.success(iBillService.selectCurrBill(mobile));
        return  AjaxResult.success(iBillService.selectCurrBillActive(mobile));
    }
    @RequestMapping(value = "/selectCurrBillDetail",method = RequestMethod.POST)
    public AjaxResult selectCurrBillDetail(@RequestParam("loanNo") String loanNo){
        //return AjaxResult.success(iBillService.selectCurrBill(mobile));
        return  AjaxResult.success(iBillService.selectCurrBill(loanNo));
    }

}
